import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CircleReplyVO, CircleReplyForm, CircleReplyQuery } from '@/api/system/circleReply/types';

/**
 * 查询圈子回复列表
 * @param query
 * @returns {*}
 */

export const listCircleReply = (query?: CircleReplyQuery): AxiosPromise<CircleReplyVO[]> => {
  return request({
    url: '/system/circleReply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询圈子回复详细
 * @param id
 */
export const getCircleReply = (id: string | number): AxiosPromise<CircleReplyVO> => {
  return request({
    url: '/system/circleReply/' + id,
    method: 'get'
  });
};

/**
 * 新增圈子回复
 * @param data
 */
export const addCircleReply = (data: CircleReplyForm) => {
  return request({
    url: '/system/circleReply',
    method: 'post',
    data: data
  });
};

/**
 * 修改圈子回复
 * @param data
 */
export const updateCircleReply = (data: CircleReplyForm) => {
  return request({
    url: '/system/circleReply',
    method: 'put',
    data: data
  });
};

/**
 * 删除圈子回复
 * @param id
 */
export const delCircleReply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/circleReply/' + id,
    method: 'delete'
  });
};
